<!DOCTYPE html>
<html>
<head>
    <title>系统日志</title>
    <#include "/header.html">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <div style="margin: 10px 0">
            <form class="layui-form layui-form-pane" action="" id="searchForm">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">用户</label>
                        <div class="layui-input-inline">
                            <input type="text" name="username" placeholder="搜索用户" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">操作</label>
                        <div class="layui-input-inline">
                            <input type="text" name="operation" placeholder="搜索操作" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button type="submit" class="layui-btn layui-btn-primary layui-border-blue" lay-submit lay-filter="form-search-btn"><i class="layui-icon layui-icon-search"></i>搜索</button>
                        <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="form-reset-btn"><i class="layui-icon layui-icon-refresh"></i>重置</button>
                    </div>
                </div>
            </form>
        </div>

        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

    </div>
</div>
<script type="text/javascript">
    layui.use(['table'], function () {
        var $ = layui.jquery,
            table = layui.table;

        table.render({
            elem: '#currentTableId',
            url: serverUrl('sys/log/list'),
            toolbar: true, //开启工具条
            title: '系统日志',
            // defaultToolbar: ['filter', 'print', 'exports'],
            cols: [[
                {type: "numbers", width: 80},
                {field: 'username', minWidth: 120, title: '用户'},
                {field: 'operation', minWidth: 120, title: '操作'},
                {field: 'method', minWidth: 180, title: '请求方法'},
                {field: 'params', minWidth: 180, title: '请求参数'},
                {field: 'time', width: 100, title: '时长(毫秒)'},
                {field: 'ip', width: 150, title: 'IP地址'},
                {field: 'createDate', title: '创建时间', width: 160}
            ]],
            limits: [15, 30, 50],
            limit: 15,
            page: true
        });

        initSearchForm('searchForm', 'currentTableId');

    });
</script>

</body>
</html>